package com.chinacache.maint.workorder.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import com.chinacache.maint.commons.entity.BaseEntity;

@Entity
@Table(name = "WO_FLOWFIELDCLASS")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class FlowFieldClass extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private Integer order;
	private Flow flow;
	private FieldClass fieldClass;

	@ManyToOne
	@JoinColumn(name = "FLOW_ID")
	public Flow getFlow() {
		return flow;
	}

	public void setFlow(Flow flow) {
		this.flow = flow;
	}

	@ManyToOne
	@JoinColumn(name = "FIELDCLASS_ID")
	public FieldClass getFieldClass() {
		return fieldClass;
	}

	public void setFieldClass(FieldClass fieldClass) {
		this.fieldClass = fieldClass;
	}

	@Id
	@Column(name = "FLOWFIELD_ID")
	@GeneratedValue(generator = "SEQ_RPT_USER_TO_CLASS")
	@GenericGenerator(name = "SEQ_RPT_USER_TO_CLASS", strategy = "seqhilo", parameters = { @Parameter(name = "sequence", value = "SEQ_RPT_USER_TO_CLASS") })
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "FIELD_ORDER")
	public Integer getOrder() {
		return order;
	}

	public void setOrder(Integer order) {
		this.order = order;
	}
}
